package com.nie.shoppdevstudy.service;

import com.nie.shoppdevstudy.bean.User;
import com.nie.shoppdevstudy.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    UserMapper mapper;
    //通过用户名查询用户
    public User getUserByName(String userName){
        return mapper.queryUserByName(userName);
    }
    //通过手机号查询用户
    public User getUserByPhone(String phoneNumber){
        return mapper.queryUserByPhone(phoneNumber);
    }
    //注册成功，添加用户
    public void addUser(User user){
        mapper.addUser(user);
    }

}
